home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / xf86Parser.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-04-12  |  11.9 KB  |  480 lines

  1. /* $XFree86: xc/programs/Xserver/hw/xfree86/parser/xf86Parser.h,v 1.33 2003/10/08 14:58:30 dawes Exp $ */
  2. /* 
  3.  * 
  4.  * Copyright (c) 1997  Metro Link Incorporated
  5.  * 
  6.  * Permission is hereby granted, free of charge, to any person obtaining a
  7.  * copy of this software and associated documentation files (the "Software"), 
  8.  * to deal in the Software without restriction, including without limitation
  9.  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  10.  * and/or sell copies of the Software, and to permit persons to whom the
  11.  * Software is furnished to do so, subject to the following conditions:
  12.  * 
  13.  * The above copyright notice and this permission notice shall be included in
  14.  * all copies or substantial portions of the Software.
  15.  * 
  16.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  19.  * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  20.  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
  21.  * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  22.  * SOFTWARE.
  23.  * 
  24.  * Except as contained in this notice, the name of the Metro Link shall not be
  25.  * used in advertising or otherwise to promote the sale, use or other dealings
  26.  * in this Software without prior written authorization from Metro Link.
  27.  * 
  28.  */
  29. /*
  30.  * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
  31.  *
  32.  * Permission is hereby granted, free of charge, to any person obtaining a
  33.  * copy of this software and associated documentation files (the "Software"),
  34.  * to deal in the Software without restriction, including without limitation
  35.  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  36.  * and/or sell copies of the Software, and to permit persons to whom the
  37.  * Software is furnished to do so, subject to the following conditions:
  38.  *
  39.  * The above copyright notice and this permission notice shall be included in
  40.  * all copies or substantial portions of the Software.
  41.  *
  42.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  43.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  44.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  45.  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  46.  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  47.  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  48.  * OTHER DEALINGS IN THE SOFTWARE.
  49.  *
  50.  * Except as contained in this notice, the name of the copyright holder(s)
  51.  * and author(s) shall not be used in advertising or otherwise to promote
  52.  * the sale, use or other dealings in this Software without prior written
  53.  * authorization from the copyright holder(s) and author(s).
  54.  */
  55.  
  56.  
  57. /* 
  58.  * This file contains the external interfaces for the XFree86 configuration
  59.  * file parser.
  60.  */
  61. #ifndef _xf86Parser_h_
  62. #define _xf86Parser_h_
  63.  
  64. #include "xf86Optrec.h"
  65.  
  66. #define HAVE_PARSER_DECLS
  67.  
  68. typedef struct
  69. {
  70.     char *file_logfile;
  71.     char *file_rgbpath;
  72.     char *file_modulepath;
  73.     char *file_inputdevs;
  74.     char *file_fontpath;
  75.     char *file_comment;
  76. }
  77. XF86ConfFilesRec, *XF86ConfFilesPtr;
  78.  
  79. /* Values for load_type */
  80. #define XF86_LOAD_MODULE    0
  81. #define XF86_LOAD_DRIVER    1
  82.  
  83. typedef struct
  84. {
  85.     GenericListRec list;
  86.     int load_type;
  87.     char *load_name;
  88.     XF86OptionPtr load_opt;
  89.     char *load_comment;
  90. }
  91. XF86LoadRec, *XF86LoadPtr;
  92.  
  93. typedef struct
  94. {
  95.     XF86LoadPtr mod_load_lst;
  96.     char *mod_comment;
  97. }
  98. XF86ConfModuleRec, *XF86ConfModulePtr;
  99.  
  100. #define CONF_IMPLICIT_KEYBOARD    "Implicit Core Keyboard"
  101.  
  102. #define CONF_IMPLICIT_POINTER    "Implicit Core Pointer"
  103.  
  104. #define XF86CONF_PHSYNC    0x0001
  105. #define XF86CONF_NHSYNC    0x0002
  106. #define XF86CONF_PVSYNC    0x0004
  107. #define XF86CONF_NVSYNC    0x0008
  108. #define XF86CONF_INTERLACE 0x0010
  109. #define XF86CONF_DBLSCAN   0x0020
  110. #define XF86CONF_CSYNC     0x0040
  111. #define XF86CONF_PCSYNC    0x0080
  112. #define XF86CONF_NCSYNC    0x0100
  113. #define XF86CONF_HSKEW     0x0200    /* hskew provided */
  114. #define XF86CONF_BCAST     0x0400
  115. #define XF86CONF_CUSTOM    0x0800    /* timing numbers customized by editor */
  116. #define XF86CONF_VSCAN     0x1000
  117.  
  118. typedef struct
  119. {
  120.     GenericListRec list;
  121.     char *ml_identifier;
  122.     int ml_clock;
  123.     int ml_hdisplay;
  124.     int ml_hsyncstart;
  125.     int ml_hsyncend;
  126.     int ml_htotal;
  127.     int ml_vdisplay;
  128.     int ml_vsyncstart;
  129.     int ml_vsyncend;
  130.     int ml_vtotal;
  131.     int ml_vscan;
  132.     int ml_flags;
  133.     int ml_hskew;
  134.     char *ml_comment;
  135. }
  136. XF86ConfModeLineRec, *XF86ConfModeLinePtr;
  137.  
  138. typedef struct
  139. {
  140.     GenericListRec list;
  141.     char *vp_identifier;
  142.     XF86OptionPtr vp_option_lst;
  143.     char *vp_comment;
  144. }
  145. XF86ConfVideoPortRec, *XF86ConfVideoPortPtr;
  146.  
  147. typedef struct
  148. {
  149.     GenericListRec list;
  150.     char *va_identifier;
  151.     char *va_vendor;
  152.     char *va_board;
  153.     char *va_busid;
  154.     char *va_driver;
  155.     XF86OptionPtr va_option_lst;
  156.     XF86ConfVideoPortPtr va_port_lst;
  157.     char *va_fwdref;
  158.     char *va_comment;
  159. }
  160. XF86ConfVideoAdaptorRec, *XF86ConfVideoAdaptorPtr;
  161.  
  162. #define CONF_MAX_HSYNC 8
  163. #define CONF_MAX_VREFRESH 8
  164.  
  165. typedef struct
  166. {
  167.     float hi, lo;
  168. }
  169. parser_range;
  170.  
  171. typedef struct
  172. {
  173.     int red, green, blue;
  174. }
  175. parser_rgb;
  176.  
  177. typedef struct
  178. {
  179.     GenericListRec list;
  180.     char *modes_identifier;
  181.     XF86ConfModeLinePtr mon_modeline_lst;
  182.     char *modes_comment;
  183. }
  184. XF86ConfModesRec, *XF86ConfModesPtr;
  185.  
  186. typedef struct
  187. {
  188.     GenericListRec list;
  189.     char *ml_modes_str;
  190.     XF86ConfModesPtr ml_modes;
  191. }
  192. XF86ConfModesLinkRec, *XF86ConfModesLinkPtr;
  193.  
  194. typedef struct
  195. {
  196.     GenericListRec list;
  197.     char *mon_identifier;
  198.     char *mon_vendor;
  199.     char *mon_modelname;
  200.     int mon_width;                /* in mm */
  201.     int mon_height;                /* in mm */
  202.     XF86ConfModeLinePtr mon_modeline_lst;
  203.     int mon_n_hsync;
  204.     parser_range mon_hsync[CONF_MAX_HSYNC];
  205.     int mon_n_vrefresh;
  206.     parser_range mon_vrefresh[CONF_MAX_VREFRESH];
  207.     float mon_gamma_red;
  208.     float mon_gamma_green;
  209.     float mon_gamma_blue;
  210.     XF86OptionPtr mon_option_lst;
  211.     XF86ConfModesLinkPtr mon_modes_sect_lst;
  212.     char *mon_comment;
  213. }
  214. XF86ConfMonitorRec, *XF86ConfMonitorPtr;
  215.  
  216. #define CONF_MAXDACSPEEDS 4
  217. #define CONF_MAXCLOCKS    128
  218.  
  219. typedef struct
  220. {
  221.     GenericListRec list;
  222.     char *dev_identifier;
  223.     char *dev_vendor;
  224.     char *dev_board;
  225.     char *dev_chipset;
  226.     char *dev_busid;
  227.     char *dev_card;
  228.     char *dev_driver;
  229.     char *dev_ramdac;
  230.     int dev_dacSpeeds[CONF_MAXDACSPEEDS];
  231.     int dev_videoram;
  232.     int dev_textclockfreq;
  233.     unsigned long dev_bios_base;
  234.     unsigned long dev_mem_base;
  235.     unsigned long dev_io_base;
  236.     char *dev_clockchip;
  237.     int dev_clocks;
  238.     int dev_clock[CONF_MAXCLOCKS];
  239.     int dev_chipid;
  240.     int dev_chiprev;
  241.     int dev_irq;
  242.     int dev_screen;
  243.     XF86OptionPtr dev_option_lst;
  244.     char *dev_comment;
  245. }
  246. XF86ConfDeviceRec, *XF86ConfDevicePtr;
  247.  
  248. typedef struct
  249. {
  250.     GenericListRec list;
  251.     char *mode_name;
  252. }
  253. XF86ModeRec, *XF86ModePtr;
  254.  
  255. typedef struct
  256. {
  257.     GenericListRec list;
  258.     int disp_frameX0;
  259.     int disp_frameY0;
  260.     int disp_virtualX;
  261.     int disp_virtualY;
  262.     int disp_depth;
  263.     int disp_bpp;
  264.     char *disp_visual;
  265.     parser_rgb disp_weight;
  266.     parser_rgb disp_black;
  267.     parser_rgb disp_white;
  268.     XF86ModePtr disp_mode_lst;
  269.     XF86OptionPtr disp_option_lst;
  270.     char *disp_comment;
  271. }
  272. XF86ConfDisplayRec, *XF86ConfDisplayPtr;
  273.  
  274. typedef struct
  275. {
  276.     XF86OptionPtr flg_option_lst;
  277.     char *flg_comment;
  278. }
  279. XF86ConfFlagsRec, *XF86ConfFlagsPtr;
  280.  
  281. typedef struct
  282. {
  283.     GenericListRec list;
  284.     char *al_adaptor_str;
  285.     XF86ConfVideoAdaptorPtr al_adaptor;
  286. }
  287. XF86ConfAdaptorLinkRec, *XF86ConfAdaptorLinkPtr;
  288.  
  289. typedef struct
  290. {
  291.     GenericListRec list;
  292.     char *scrn_identifier;
  293.     char *scrn_obso_driver;
  294.     int scrn_defaultdepth;
  295.     int scrn_defaultbpp;
  296.     int scrn_defaultfbbpp;
  297.     char *scrn_monitor_str;
  298.     XF86ConfMonitorPtr scrn_monitor;
  299.     char *scrn_device_str;
  300.     XF86ConfDevicePtr scrn_device;
  301.     XF86ConfAdaptorLinkPtr scrn_adaptor_lst;
  302.     XF86ConfDisplayPtr scrn_display_lst;
  303.     XF86OptionPtr scrn_option_lst;
  304.     char *scrn_comment;
  305. }
  306. XF86ConfScreenRec, *XF86ConfScreenPtr;
  307.  
  308. typedef struct
  309. {
  310.     GenericListRec list;
  311.     char *inp_identifier;
  312.     char *inp_driver;
  313.     XF86OptionPtr inp_option_lst;
  314.     char *inp_comment;
  315. }
  316. XF86ConfInputRec, *XF86ConfInputPtr;
  317.  
  318. typedef struct
  319. {
  320.     GenericListRec list;
  321.     XF86ConfInputPtr iref_inputdev;
  322.     char *iref_inputdev_str;
  323.     XF86OptionPtr iref_option_lst;
  324. }
  325. XF86ConfInputrefRec, *XF86ConfInputrefPtr;
  326.  
  327. /* Values for adj_where */
  328. #define CONF_ADJ_OBSOLETE    -1
  329. #define CONF_ADJ_ABSOLUTE    0
  330. #define CONF_ADJ_RIGHTOF    1
  331. #define CONF_ADJ_LEFTOF        2
  332. #define CONF_ADJ_ABOVE        3
  333. #define CONF_ADJ_BELOW        4
  334. #define CONF_ADJ_RELATIVE    5
  335.  
  336. typedef struct
  337. {
  338.     GenericListRec list;
  339.     int adj_scrnum;
  340.     XF86ConfScreenPtr adj_screen;
  341.     char *adj_screen_str;
  342.     XF86ConfScreenPtr adj_top;
  343.     char *adj_top_str;
  344.     XF86ConfScreenPtr adj_bottom;
  345.     char *adj_bottom_str;
  346.     XF86ConfScreenPtr adj_left;
  347.     char *adj_left_str;
  348.     XF86ConfScreenPtr adj_right;
  349.     char *adj_right_str;
  350.     int adj_where;
  351.     int adj_x;
  352.     int adj_y;
  353.     char *adj_refscreen;
  354. }
  355. XF86ConfAdjacencyRec, *XF86ConfAdjacencyPtr;
  356.  
  357. typedef struct
  358. {
  359.     GenericListRec list;
  360.     char *inactive_device_str;
  361.     XF86ConfDevicePtr inactive_device;
  362. }
  363. XF86ConfInactiveRec, *XF86ConfInactivePtr;
  364.  
  365. typedef struct
  366. {
  367.     GenericListRec list;
  368.     char *lay_identifier;
  369.     XF86ConfAdjacencyPtr lay_adjacency_lst;
  370.     XF86ConfInactivePtr lay_inactive_lst;
  371.     XF86ConfInputrefPtr lay_input_lst;
  372.     XF86OptionPtr lay_option_lst;
  373.     char *lay_comment;
  374. }
  375. XF86ConfLayoutRec, *XF86ConfLayoutPtr;
  376.  
  377. typedef struct 
  378.     GenericListRec list; 
  379.     char *vs_name;
  380.     char *vs_identifier;
  381.     XF86OptionPtr vs_option_lst;
  382.     char *vs_comment;
  383. }
  384. XF86ConfVendSubRec, *XF86ConfVendSubPtr;
  385.  
  386. typedef struct
  387. {
  388.     GenericListRec list;
  389.     char *vnd_identifier;
  390.     XF86OptionPtr vnd_option_lst;
  391.     XF86ConfVendSubPtr vnd_sub_lst;
  392.     char *vnd_comment;
  393. }
  394. XF86ConfVendorRec, *XF86ConfVendorPtr;
  395.  
  396. typedef struct
  397. {
  398.     GenericListRec list;
  399.     int buf_count;
  400.     int buf_size;
  401.     char *buf_flags;
  402.     char *buf_comment;
  403. }
  404. XF86ConfBuffersRec, *XF86ConfBuffersPtr;
  405.  
  406. typedef struct
  407. {
  408.     char *dri_group_name;
  409.     int dri_group;
  410.     int dri_mode;
  411.     XF86ConfBuffersPtr dri_buffers_lst;
  412.     char *dri_comment;
  413. }
  414. XF86ConfDRIRec, *XF86ConfDRIPtr;
  415.  
  416. typedef struct
  417. {
  418.     XF86OptionPtr ext_option_lst;
  419.     char *extensions_comment;
  420. }
  421. XF86ConfExtensionsRec, *XF86ConfExtensionsPtr;
  422.  
  423. typedef struct
  424. {
  425.     XF86ConfFilesPtr conf_files;
  426.     XF86ConfModulePtr conf_modules;
  427.     XF86ConfFlagsPtr conf_flags;
  428.     XF86ConfVideoAdaptorPtr conf_videoadaptor_lst;
  429.     XF86ConfModesPtr conf_modes_lst;
  430.     XF86ConfMonitorPtr conf_monitor_lst;
  431.     XF86ConfDevicePtr conf_device_lst;
  432.     XF86ConfScreenPtr conf_screen_lst;
  433.     XF86ConfInputPtr conf_input_lst;
  434.     XF86ConfLayoutPtr conf_layout_lst;
  435.     XF86ConfVendorPtr conf_vendor_lst;
  436.     XF86ConfDRIPtr conf_dri;
  437.     XF86ConfExtensionsPtr conf_extensions;
  438.     char *conf_comment;
  439. }
  440. XF86ConfigRec, *XF86ConfigPtr;
  441.  
  442. typedef struct
  443. {
  444.     int token;            /* id of the token */
  445.     char *name;            /* pointer to the LOWERCASED name */
  446. }
  447. xf86ConfigSymTabRec, *xf86ConfigSymTabPtr;
  448.  
  449. /*
  450.  * prototypes for public functions
  451.  */
  452. extern const char *xf86openConfigFile (const char *, const char *,
  453.                     const char *);
  454. extern void xf86setBuiltinConfig(const char *config[]);
  455. extern XF86ConfigPtr xf86readConfigFile (void);
  456. extern void xf86closeConfigFile (void);
  457. extern void xf86freeConfig (XF86ConfigPtr p);
  458. extern int xf86writeConfigFile (const char *, XF86ConfigPtr);
  459. XF86ConfDevicePtr xf86findDevice(const char *ident, XF86ConfDevicePtr p);
  460. XF86ConfLayoutPtr xf86findLayout(const char *name, XF86ConfLayoutPtr list);
  461. XF86ConfMonitorPtr xf86findMonitor(const char *ident, XF86ConfMonitorPtr p);
  462. XF86ConfModesPtr xf86findModes(const char *ident, XF86ConfModesPtr p);
  463. XF86ConfModeLinePtr xf86findModeLine(const char *ident, XF86ConfModeLinePtr p);
  464. XF86ConfScreenPtr xf86findScreen(const char *ident, XF86ConfScreenPtr p);
  465. XF86ConfInputPtr xf86findInput(const char *ident, XF86ConfInputPtr p);
  466. XF86ConfInputPtr xf86findInputByDriver(const char *driver, XF86ConfInputPtr p);
  467. XF86ConfVendorPtr xf86findVendor(const char *name, XF86ConfVendorPtr list);
  468. XF86ConfVideoAdaptorPtr xf86findVideoAdaptor(const char *ident,
  469.                         XF86ConfVideoAdaptorPtr p);
  470.  
  471. GenericListPtr xf86addListItem(GenericListPtr head, GenericListPtr c_new);
  472. int xf86itemNotSublist(GenericListPtr list_1, GenericListPtr list_2);
  473.  
  474. int xf86pathIsAbsolute(const char *path);
  475. int xf86pathIsSafe(const char *path);
  476. char *xf86addComment(char *cur, char *add);
  477.  
  478. #endif /* _xf86Parser_h_ */
  479.